/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2022-12-20
 * Time: 19:32
 */
public class CompleteNumber {
    public static void main(String[] args) {
        int sum=0;
        for (int i = 1; i < 1000; i++) {
            sum=0;
            for (int j = 2; j < Math.sqrt(i); j++) {
                if(i%j==0){
                    sum+=(j+i/j);
                }
            }
            if (1 + sum == i) {
                System.out.println(i);
            }
        }
    }
}
